# $Id$
# Maintainer: Evangelos Foutras <evangelos@foutrelis.com>
# Contributor: Tobias Powalowski <tpowa@archlinux.org>
# Contributor: Hokum <hokum_at_mail_dot_ru>

pkgname=gptfdisk
pkgver=1.0.4
pkgrel=1
pkgdesc="A text-mode partitioning tool that works on GUID Partition Table (GPT) disks"
arch=('x86_64')
url="https://www.rodsbooks.com/gdisk/"
license=('GPL2')
depends=('gcc-libs' 'popt' 'libuuid.so' 'libncursesw.so')
provides=("gdisk=$pkgver")
conflicts=('gdisk')
replaces=('gdisk')
source=(https://downloads.sourceforge.net/project/$pkgname/$pkgname/$pkgver/$pkgname-$pkgver.tar.gz)
sha256sums=('b663391a6876f19a3cd901d862423a16e2b5ceaa2f4a3b9bb681e64b9c7ba78d')

build() {
  cd "$srcdir/$pkgname-$pkgver"
  make
}

check() {
  cd "$srcdir/$pkgname-$pkgver"
  make test
}

package () {
  cd "$srcdir/$pkgname-$pkgver"

  install -d "$pkgdir"/usr/{bin,share/{doc/gdisk,man/man8}}
  install -t "$pkgdir/usr/bin" {,c,s}gdisk fixparts
  install -m644 -t "$pkgdir/usr/share/man/man8" {{,c,s}gdisk,fixparts}.8
  install -m644 -t "$pkgdir/usr/share/doc/gdisk" README NEWS
}
